import 'package:flutter/material.dart';

class MyApp9 extends StatelessWidget {
  const MyApp9({super.key});

  @override
  Widget build(BuildContext context) {
    return Scaffold(
        //1.导航
        appBar: AppBar(
          title: const Text('堆叠组件'),
          backgroundColor: Colors.pink,
        ),
        //2.内容
        body: Center(
            child: Stack(
                //设置堆叠容器内部组件的对齐方式
                alignment: Alignment.center,
                //不裁剪超出的部分
                clipBehavior: Clip.none,
                children: [
              Container(
                width: 200,
                height: 200,
                //背景颜色
                color: Colors.cyan,
              ),
              Container(
                width: 100,
                height: 100,
                //背景颜色
                color: Colors.yellow,
              ),
              Image.network(
                  'https://yanxuan-item.nosdn.127.net/afd6199278a5b8fd783bc4947960fabc.jpg',
                  width: 86),
              //定位组件
              Positioned(
                top: -100,
                child: Image.asset('open_eyes.png'),
              )
            ])));
  }
}

class ColumnAndRowCaseItem extends StatelessWidget {
  const ColumnAndRowCaseItem({Key? key}) : super(key: key);

  @override
  Widget build(BuildContext context) {
    return Container(
      width: 70,
      height: 70,
      margin: EdgeInsets.only(left: 10),
      child: Container(
        width: double.infinity,
        height: double.infinity,
        decoration: BoxDecoration(
          borderRadius: BorderRadius.circular(35),
          color: Colors.blue,
        ),
      ),
    );
  }
}
